function getLocation() {
	return new Promise(function(resolve, reject) {
		// 获取定位
		uni.getLocation({
			type: 'gcj02',
			geocode: true,
			highAccuracyExpireTime: 100000,
			success: res => {
				console.log(res, '获取位置成功')
				// #ifdef MP-WEIXIN
				uni.request({
					url: 'https://restapi.amap.com/v3/geocode/regeo',
					data: {
						key: 'f327999b920be4e33adccaf6299d63ad',
						location: res.longitude + ',' + res.latitude
					},
					success: res1 => {
						resolve(res1.data.regeocode.addressComponent);
					},
					fail: err => {
						console.log(err, '逆地址解析失败')
						reject(err);
					}
				})
				// #endif
				// #ifdef APP-PLUS
				resolve(res.address);
				// #endif
			},
			fail: err => {
				console.log(err, '获取位置失败')
				reject(err);
			}
		});
	});
}

export default getLocation;